package com.hc.model.code04.test9;

import java.util.ArrayList;
import java.util.List;

/**
 * @version v1.0
 * @ClassName: Home
 * @Description: 具体的对象结构角色类
 * @Author: HC
 */
public class Home {
    private List<Animal> nodeList = new ArrayList<>();

    void action(Person person) {
        for (Animal animal : nodeList) {
            animal.accept(person);
        }
    }

    void add(Animal animal) {
        nodeList.add(animal);
    }

}
